import com.java.demo.TestBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-08-31
 * Time: 11:32
 */
public class App {
    public static void main(String[] args) {
        // 1.获取Spring上下文
        ApplicationContext context =
                new ClassPathXmlApplicationContext("spring-config.xml");
        // 2.获取 Bean 对象
        TestBean testBean = context.getBean("testBean", TestBean.class);
        // 3.使用 Bean 对象
        testBean.sayHi();
    }
}
